package com.heima.sjms.template;

/**
 * 1. 将固定的内容写在模板内
 * 2. 将变化的内容抽象出来，写在模板子类中
 */
public abstract class EatTemplate {

    public void eat(){
        System.out.println("拿个盘子...");

        choiceDish();

        System.out.println("扫码结账...");
    }

    public abstract void choiceDish();
}


class ZhangSan extends EatTemplate{

    @Override
    public void choiceDish() {
        System.out.println("来个鸡腿");
        System.out.println("来个西红柿炒蛋");
        System.out.println("来个韭菜豆芽");
    }
}

class Lisi extends EatTemplate{

    @Override
    public void choiceDish() {
        System.out.println("来个黄桃炖排骨");
        System.out.println("来个辣椒炒肉");
        System.out.println("来个麻婆豆腐");
    }
}